<script src="//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<script>
if(window.config.container=='wxwork'){
	wx.agentConfig({
			corpid: jssdkconfig.corpid,
			agentid: jssdkconfig.agentid,
			timestamp: jssdkconfig.timestamp,
			nonceStr: jssdkconfig.nonceStr,
			signature: jssdkconfig.signature,
			jsApiList: [
				'selectExternalContact',
				'openUserProfile',
				'getContext',
				'getCurExternalContact',
				'getCurExternalChat',
				'sendChatMessage',
				'shareToExternalContact',
				'shareToExternalChat',
				'navigateToAddCustomer'
			],
			success: function(res) {
				window.config.isagentConfig=1;
				wx.onMenuShareAppMessage(window.sharedata);
				wx.onMenuShareWechat(window.sharedata);
				wx.onMenuShareTimeline(window.sharedata);
			},
			fail: function(res) {
				//alert(res.errMsg)
				if(res.errMsg.indexOf('function not exist') > -1){
					alert('企业微信版本过低请升级')
				}
			}
	});
}
</script>